An R Package for Reactive Biplots R
Ruan Buys
Carel van der Merwe
Sugnet Lubbe
SASA 2024
# Initial stress : 0.02554
# stress after 10 iters: 0.01094, magic = 0.500
# stress after 20 iters: 0.01080, magic = 0.500
# stress after 30 iters: 0.01078, magic = 0.500
# Calculating spline axis for variable 1
# Calculating spline axis for variable 2
# Calculating spline axis for variable 3
# Calculating spline axis for variable 4
sunspots <- matrix (sunspot.month[1:(264*12)], ncol = 12, byrow = TRUE)
years <- 1749:2012
rownames(sunspots) <- years
colnames(sunspots) <- c("Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec")
century <-paste(floor((years-1)/100)+1, ifelse (floor((years-1)/100)+1<21, "th","st"), sep = "-")
x<- biplot(sunspots, group.aes=century) |> PCA() |>
axes (label.dir = "Hor", label.line = c(0.8, rep(0,10), 0.8)) |>
alpha.bags () |>
legend.type(bags = TRUE) |> plot()# Computing 0.95 -bag for 18-th
# Computing 0.95 -bag for 19-th
# Computing 0.95 -bag for 20-th
# Computing 0.95 -bag for 21-st
# Computing 2.15 -ellipse for 18-th
# Computing 2.15 -ellipse for 19-th
# Computing 2.15 -ellipse for 20-th
# Computing 2.15 -ellipse for 21-st
# Computing 2.45 -ellipse for 18-th
# Computing 2.45 -ellipse for 19-th
# Computing 2.45 -ellipse for 20-th
# Computing 2.45 -ellipse for 21-st